Fix A-ASSOCIATE-RQ/AC error-path leaks in DUL FSM.
authorMichael Onken <onken@open-connections.de>
Tue, 7 Jul 2026 20:38:06 +0000 (22:38 +0200)
committerÉtienne Mollier <emollier@debian.org>
Tue, 7 Jul 2026 20:38:06 +0000 (22:38 +0200)
commitac2272ed6a1fa985ab4057f0332891b32c07f612
treed14aa156f5f397db7da47aed9b0f0321c2fe7574
parent58f7c98f7214cbac5934d30e2ba8bdf56976b4f4
Fix A-ASSOCIATE-RQ/AC error-path leaks in DUL FSM.

Applied-Upstream: 2312891a8d058c862e00bcbd636e5da26308658a
Last-Update: 2026-05-29
Reviewed-By: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/1141411

AE_3_AssociateConfirmationAccept and AE_6_ExamineAssociateRequest leaked
the whole parsed PDU graph (presentation contexts, transfer syntax
sub-chains, role list, user info) on error returns taken after
parseAssociate() succeeded, since only the success path freed it. For an
SCP this is remotely triggerable and accumulates per connection.

Free the parsed PDU before each such return;
translatePresentationContextList() also frees the proposed transfer
syntax list of a rejected context. Add a dcmnet regression test
(tassocleak.cc) driving the AE_6 zero-transfer-syntax path against an
in-process DcmSCP; leak-clean with the fix under DCMTK_WITH_SANITIZERS.

Thanks for the report and analysis to Abhinav Agarwal.

This closes DCMTK issue #1217.

Gbp-Pq: Name 0022-CVE-2026-35505.patch
dcmnet/libsrc/dulfsm.cc
dcmnet/tests/CMakeLists.txt
dcmnet/tests/Makefile.in
dcmnet/tests/tassocleak.cc [new file with mode: 0644]
dcmnet/tests/tests.cc